# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-netfilterqueue
pkgname=('python2-netfilterqueue' 'python-netfilterqueue')
_pkgname=NetfilterQueue
pkgver=0.8.1
pkgrel=9
pkgdesc='A Python bindings for libnetfilter_queue.'
url='https://github.com/fqrouter/python-netfilterqueue'
arch=('x86_64' 'aarch64')
license=('MIT')
depends=('python2' 'libnetfilter_queue')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://pypi.python.org/packages/39/c4/8f73f70442aa4094b3c37876c96cddad2c3e74c058f6cd9cb017d37ffac0/$_pkgname-$pkgver.tar.gz")
sha512sums=('03104d7a1a841e85d75d6e8e20fa217bd5e8e883d417721121ea1feb0ca2487e8d970313a2b0dd1a57849b44457ef81d5a177aaec74bc46797201c143282b438')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-netfilterqueue() {
  depends=('python2' 'libnetfilter_queue')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-netfilterqueue() {
  depends=('python' 'libnetfilter_queue')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

